#include<iostream>
#include<csignal>
#include<sys/types.h>
#include<unistd.h>

using namespace std;

void myhandler(int signal)
{
    cout<<"signal is :"<<signal<<endl;
}

int main()
{
    signal(2,myhandler);
    
    while(1)
    {
        cout<<"my pid is :"<<getpid()<<endl;
        sleep(1);
    }

    return 0;
}